package cn.middle.swap.portal;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import com.middle.common.result.Page;

import cn.dev33.satoken.annotation.SaCheckPermission;
import cn.middle.swap.entity.Park;
import cn.middle.swap.service.ParkService;

/**
 * 园区列表
 * @author KING
 *
 */
@Controller
@RequestMapping("/park")
public class ParkController {
	
	private final static String PREFIX = "swap/park/";
	
	@Autowired
	private ParkService parkService;
	@SaCheckPermission("park:list")
	@GetMapping("/list")
	public String list(@RequestParam(value = "page", defaultValue = "1") Integer pageNum,
			@RequestParam(value = "pageSize", defaultValue = "10") Integer limit, String parkCode,
			String parkName, ModelMap modelMap) {
		Page<Park> pageInfo = parkService.listConditions(pageNum, limit, parkCode, parkName);
		modelMap.put("pageInfo", pageInfo);
		modelMap.put("parkCode", parkCode);
		modelMap.put("parkName", parkName);
		return PREFIX + "list";
	}

}
